package com.xiaojie.demo.controller;

import com.xiaojie.demo.common.R;
import com.xiaojie.demo.service.TransferService;
import com.xiaojie.summer.annotation.Autowired;
import com.xiaojie.summer.annotation.Controller;
import com.xiaojie.summer.annotation.RequestMapping;

/**
 * @author Nick
 * @date 2021/5/22
 * @description 转账控制层
 */
@Controller
@RequestMapping("/api")
public class TransferController {

    @Autowired
    private TransferService transferService;

    @RequestMapping("/transfer")
    public R transfer(String fromCardNo, String toCardNo, int money) {

        transferService.transfer(fromCardNo, toCardNo, money);
        return R.ok();
    }

    @Override
    public String toString() {
        return "TransferController{" +
                "transferService=" + transferService +
                '}';
    }
}
